import $api from './index';

interface RoleData {
    name?:string;
    path?:string;
    action?:string;
    pid:number | string;
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    [key:string]: any;
}

export const getUser = () => $api.get('/users');
export const addRole = (data: RoleData) => $api.post('/role', data);
export const allRole = () => $api.get('/role');
export const delRole = (id: string | number) => $api.delete(`/role/${id}`);
export const updateRole = (uid: string | number, roles: RoleData) => $api.post(`/users/${uid}`, { roles });
export default {};
